﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace devtm.AutoMapper.CustomCode.TemplateAdd
{
    
    public enum MatchingModel
    {
        MatchCaseSensitive,
        MatchCaseUnsensitive
    }

    public class LinkPolicy
    {

        private static LinkPolicy _instance = null;
        public static LinkPolicy Get() { return _instance; }

        public LinkPolicy()
        {
            _instance = this;
        }

        public MatchingModel Mode { get; set; }


        internal bool Match(string p1, string p2, MemberTypeEnum memberTypeEnum)
        {

            switch (Mode)
            {

                case MatchingModel.MatchCaseSensitive:
                    return p1 == p2;

                case MatchingModel.MatchCaseUnsensitive:
                    return p1.ToLower() == p2.ToLower();
                    
            }

            return true;

        }


    }



}
